<?php require_once('../Connections/agriculture.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];

$maxRows_caihouEditRecordset1 = 10;
$pageNum_caihouEditRecordset1 = 0;
if (isset($_GET['pageNum_caihouEditRecordset1'])) {
  $pageNum_caihouEditRecordset1 = $_GET['pageNum_caihouEditRecordset1'];
}
$startRow_caihouEditRecordset1 = $pageNum_caihouEditRecordset1 * $maxRows_caihouEditRecordset1;

mysql_select_db($database_agriculture, $agriculture);
$query_caihouEditRecordset1 = "SELECT * FROM pick";
$query_limit_caihouEditRecordset1 = sprintf("%s LIMIT %d, %d", $query_caihouEditRecordset1, $startRow_caihouEditRecordset1, $maxRows_caihouEditRecordset1);
$caihouEditRecordset1 = mysql_query($query_limit_caihouEditRecordset1, $agriculture) or die(mysql_error());
$row_caihouEditRecordset1 = mysql_fetch_assoc($caihouEditRecordset1);

if (isset($_GET['totalRows_caihouEditRecordset1'])) {
  $totalRows_caihouEditRecordset1 = $_GET['totalRows_caihouEditRecordset1'];
} else {
  $all_caihouEditRecordset1 = mysql_query($query_caihouEditRecordset1);
  $totalRows_caihouEditRecordset1 = mysql_num_rows($all_caihouEditRecordset1);
}
$totalPages_caihouEditRecordset1 = ceil($totalRows_caihouEditRecordset1/$maxRows_caihouEditRecordset1)-1;

$queryString_caihouEditRecordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_caihouEditRecordset1") == false && 
        stristr($param, "totalRows_caihouEditRecordset1") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_caihouEditRecordset1 = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_caihouEditRecordset1 = sprintf("&totalRows_caihouEditRecordset1=%d%s", $totalRows_caihouEditRecordset1, $queryString_caihouEditRecordset1);
?><table width="718" height="202" border="1" cellpadding="0" cellspacing="0">
  <tr>
    <td width="150"><table width="150" height="200" border="1" cellpadding="0" cellspacing="0">
      <tr>
        <td width="123"><div align="center"><a href="scaihou.php">查看信息</a></div></td>
      </tr>
      <tr>
        <td><div align="center"><a href="wcaihou.php">录入信息</a></div></td>
      </tr>
      <tr>
        <td><div align="center"><a href="drcaihou.php">修改/删除信息</a></div></td>
      </tr>
      <tr>
        <td><div align="center"><a href="out.php">退出登陆</a></div></td>
      </tr>
    </table></td>
    <td width="562"><form id="form1" name="form1" method="post" action="">
      <p>
        <label>
        <input type="submit" name="Submit" value="删除选择" />
        </label>
      </p>
      <table width="526" height="55" border="1" cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;</td>
          <td>ID</td>
          <td>采摘时间</td>
          <td>果实要求</td>
          <td>储藏方法</td>
          <td>储藏时间</td>
          <td>储藏工具</td>
          <td>运输要求</td>
          <td>质量要求</td>
          <td>包装方法</td>
          <td>操作</td>
        </tr>
        <?php do { ?>
          <tr>
              <td><label>
                <input type="checkbox" name="checkbox" value="checkbox" />
              </label></td>
            <td><?php echo $row_caihouEditRecordset1['pick_id']; ?></td>
            <td><?php echo $row_caihouEditRecordset1['pick_time']; ?></td>
            <td><?php echo $row_caihouEditRecordset1['pick_fruit_require']; ?></td>
            <td><?php echo $row_caihouEditRecordset1['pick_store_method']; ?></td>
            <td><?php echo $row_caihouEditRecordset1['pick_store_time']; ?></td>
            <td><?php echo $row_caihouEditRecordset1['pick_store_tool']; ?></td>
            <td><?php echo $row_caihouEditRecordset1['pick_trans_require']; ?></td>
            <td><?php echo $row_caihouEditRecordset1['pick_fruit_standard']; ?></td>
            <td><?php echo $row_caihouEditRecordset1['pick_pack']; ?></td>
            <td>修改删除</td>
          </tr>
          <?php } while ($row_caihouEditRecordset1 = mysql_fetch_assoc($caihouEditRecordset1)); ?>
      </table>
        <p>
        <table border="0" width="50%" align="center">
          <tr>
            <td width="23%" align="center"><?php if ($pageNum_caihouEditRecordset1 > 0) { // Show if not first page ?>
                  <a href="<?php printf("%s?pageNum_caihouEditRecordset1=%d%s", $currentPage, 0, $queryString_caihouEditRecordset1); ?>">第一页</a>
                  <?php } // Show if not first page ?>
            </td>
            <td width="31%" align="center"><?php if ($pageNum_caihouEditRecordset1 > 0) { // Show if not first page ?>
                  <a href="<?php printf("%s?pageNum_caihouEditRecordset1=%d%s", $currentPage, max(0, $pageNum_caihouEditRecordset1 - 1), $queryString_caihouEditRecordset1); ?>">上一页</a>
                  <?php } // Show if not first page ?>
            </td>
            <td width="23%" align="center"><?php if ($pageNum_caihouEditRecordset1 < $totalPages_caihouEditRecordset1) { // Show if not last page ?>
                  <a href="<?php printf("%s?pageNum_caihouEditRecordset1=%d%s", $currentPage, min($totalPages_caihouEditRecordset1, $pageNum_caihouEditRecordset1 + 1), $queryString_caihouEditRecordset1); ?>">下一页</a>
                  <?php } // Show if not last page ?>
            </td>
            <td width="23%" align="center"><?php if ($pageNum_caihouEditRecordset1 < $totalPages_caihouEditRecordset1) { // Show if not last page ?>
                  <a href="<?php printf("%s?pageNum_caihouEditRecordset1=%d%s", $currentPage, $totalPages_caihouEditRecordset1, $queryString_caihouEditRecordset1); ?>">尾页</a>
                  <?php } // Show if not last page ?>
            </td>
          </tr>
        </table>
        </p>
    </form>
    </td>
  </tr>
</table>
<?php
mysql_free_result($caihouEditRecordset1);
?>
<?php
